Repository navigation
v0.9.1: Cell 5 asks what each mask is; Register shows each step as it goes (#574 items 6-7) - #578
Draft
guijacquemet wants to merge 2 commits into
Draft
guijacquemet wants to merge 2 commits into
guijacquemet wants to merge 2 commits into
Conversation
…items 6-7) Item 6: the tick box "Declare <type> as separate objects" under a TOML preview is replaced by a question per mask type with no answer chosen: "Each object has its own number (label image: every cell/nucleus is a separate object)" or "Foreground / background only (binary mask)", with one sentence on why we ask. The TOML is shown only folded (<details>). The recorded value (representation = "instances") and the refusal while a mask type is unanswered are unchanged; a binary answer is refused beside the button (Cellpose gives each object its own number), nothing records it. Item 7: Register showed nothing in cell 5 while it read, per image of a verify_content run, 4 whole files (SHA-256: cell 5's checks, the app's run, its pre-publish check, the tissue-mask step's opening) and per mask 5 (run, pre-publish check, mask step fingerprints before/after, pixels). Each read is a check or the data itself, so none is removed; reads per file and the normalized run-folder digests are identical to main. RegisterWait (notebook_progress.Wait and its ticking thread, #567) shows "Step k of 5 · <step>" with the elapsed time and the step's own line: the run's checks counted through open_run(checking=) (open_checks and run_inputs.open_checked, identical to #575's hunks), and the app's own wait lines copied while each step runs. Notebook cells are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
open_run now opens through run_inputs.open_checked (the hunks shared with #575), so the test that publishes the run while it is opened patches that function instead of RunInputs.open. Same change, byte for byte, as #575's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a
Contributor
Author
|
Paused for v0.9.0 work: the owner has answered the three questions above. This is the TODO for later. Head is still TODO, owner decisions:
Generated by Claude Code |
guijacquemet
pushed a commit
that referenced
this pull request
Nov 26, 2026
Cell 5 asks what each mask is; Register shows each step as it goes (#574 items 6-7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VbytvF3Gsa85ix8Ne2yMDW
guijacquemet
pushed a commit
that referenced
this pull request
Nov 26, 2026
Fixes #580 on top of #578's Register wait: a failed re-check stops with CHECK_FAILED and cell 3's reason; later presses and cell 5 run again refuse without AttributeError; an unexpected error is shown in cell 5 (STOPPED) and re-raised, with the wait's "Stopped after" line. Conflicts resolved so both fixes hold; the tests of #581 use #578's question (choices, not ticks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VbytvF3Gsa85ix8Ne2yMDW
guijacquemet
pushed a commit
that referenced
this pull request
Nov 26, 2026
- Binary answer for a Cellpose mask: coded refusal (cellpose_mask_not_binary) saying why (Cellpose numbers each object); binary masks from elsewhere stay declarable in cell 3. - Within one press, a content SHA-256 is reused while the file identity (st_dev, st_ino, st_size, st_mtime_ns, st_ctime_ns) is unchanged (content_memo.ContentMemo, created per press, passed explicitly; never at publication). Images: 2 whole reads per press instead of 4 (+1 for the former first press). A rewrite the identity cannot see is still refused by the run's check before it publishes (tested). - Cell 5 is displayed first (shared notebook_shown_first.ShownFirst with cell 4), then opens the run with its n-of-N wait; cell text unchanged. - One press: when the folders and image headers are unchanged since cell 3's check (register_checks.changes_since_check), the masks are paired with the app's Check the masks again and the confirmed axes are kept; otherwise the folder check is made again and the axes stop says what changed. - Refusal helpers moved to register_checks (600-line rule); install tests moved to their own file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VbytvF3Gsa85ix8Ne2yMDW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Items 6 and 7 of #574 (owner's Colab test, 26 Nov 2026), for v0.9.1: the Register the masks step (cell 5 of
MorphoBricks_Preprocessing_Cellpose). Draft: do not merge.Item 6: what each mask is, asked clearly
The tick box "Declare Cells as separate objects" under a TOML preview is replaced. For each mask type, cell 5 now asks "Cells: what is this mask?" with no answer chosen:
The help line says why: "We ask because the two are measured differently, and we never guess which one a file is." The TOML is shown only folded, in a
<details>element ("What registering it as separate objects adds to the experiment description").Unchanged:
representation = "instances"is still saved through the app's Masks question. The test checks the exact[masks.Cells]section that gets written.register()returns False without changing anything. The blocker line now says "choose what Cells is" instead of "tick the declaration of Cells".New: Cellpose gives each object its own number, so the binary answer is refused beside the button, with the reason (
BINARY_REFUSED), and nothing records it. See the owner question below.Item 7: Register reads the same files, and now shows each step
What Register reads, per file. I counted this on main with a patched opener (
builtins.open, bytes read per opening), on the cell 4/5 test experiment of 4 images. The run usesverify_content, the notebook's default.refusal→open_run)refusal), plus header reads; the first image is also read for the axis viewersrefusal→open_run; (2) the app's run,compute_rows→with_content; (3) the run's check before it publishes,generation._commit→pipeline.check; (4) the app's tissue-mask step, which opens the run after it (notebook_tissue_mask.refresh→RunInputs.open). About 9 opens. The first image is also read about 4 more times in total by the two viewers that Check and save redraws twice (_refresh_confirmed_viewers)mask_contents), its check before publishing (content_changed_masks), the mask step's fingerprints before and after reading (scan_fingerprints,check_scanned), and the pixels (read_tiff_plane, 1piece_countsper mask). 7 opensReads after this PR: identical. Every phase has the same opens, bytes read, SHA-256 calls and
piece_countscalls per file. I checked this at 512 px and at 256 px.tests/test_mask_register_progress.pypins the counts per file: images 4 whole reads, masks 5, opens 21/9/9/9 and 7 per mask; showing cell 5 reads each image whole once.Why nothing was read less. Every one of these whole reads is either a check or the data itself:
refusalbefore the run. It must refuse changed images before anything is declared or published. The run's own content pass comes after, and reusing its hashes would leave a time-of-check gap.expectedfingerprint).None of them could be removed without weakening a check. That is a question for the owner (below), so I changed none of them.
What is shown now.
notebook_register_progress.RegisterWaituses the #567 mechanism (notebook_progress.Waitand its ticking thread). I did not build a new one. It shows:Step k of 5 · <step>, whose elapsed time keeps ticking;Reading each image whole for its content SHA-256 · 2 of 200 · ctrl/rep1/a.tif. In the other steps it is the app's own wait line for its folder check, its run (Preparing: … · n of N · <file>) and its mask step, copied into cell 5 as the app draws it (anobservethat is removed when the step ends);Took m:ss.(orStopped after m:ss.after an error or interrupt).The button is disabled while Register runs.
The five steps are:
How step 1 is counted, and the overlap with #575. Step 1 is counted through
segmentation_cellpose_run.open_run(checking=). I applied #575'sopen_checks.py,run_inputs.open_checkedandopen_run/open_pinnedhunks, plus itspyproject.tomlandAGENTS.mdlines foropen_checksand its matching change totests/test_notebook_cellpose_republished.py, byte for byte, so both PRs merge cleanly in either order. A trial merge of this branch with #575's head85a4b06has no conflicts, and itstest_mask_register_progress.py,test_cellpose_folders_open.pyandtest_notebook_preprocessing_cellpose.pypass (51 tests). If #575 changes those hunks before it merges, this branch needs a rebase. I did not touch cell 4,notebook_open_progress.pyor #575'sregister_step(test.Identity evidence
I ran the same scripted press (cell 4 → cell 5 → axes stop → confirm → Register) on main and on this branch. I compared the run folder with normalized SHA-256 per file: the JSON is parsed,
written_at, file mtimes,content_sha256andmanifest_sha256are dropped, and temporary paths are replaced. Two runs of main differ only in those fields, because the test's OME-TIFFs carry a fresh UUID and cell 4 writes fresh masks.check_headers.json,discovery_report.json/.txt,experiment_design.csv,image_qc.csv,mask_relationships.json,mask_representation.json,morphobricks.toml,plane_histograms.csvandrun_manifest.json.mask_relationships.jsonandmorphobricks.tomlare byte-identical.Notebook
No cell changed. Cell 5 is still
register_step(notebook, segmentation)/display(registration), which works with the pinned release and with this code. The markdown above cell 5 still shows the TOML and says "tick each one". It describes the pinned release's widget, so I left it until RELEASE_REF moves to v0.9.1.docs/user_guide.mddescribes the new step.Tests
tests/test_mask_register_progress.py, 10 tests:<details>;refusalwith and withoutcheckinggives the same result;tests/test_notebook_preprocessing_cellpose.pynow uses.choices(the tick boxes are gone).run_inputstests: 83 passed with ipywidgets 8.1.9. The new file and the cell 4/5 tests with ipywidgets 7.7.5: 31 passed (2 install tests deselected).ruff check,ruff format --checkandtools/check.py --rulespass.tools/check.pyatacfc4d5: ruff and format clean, 8822 passed, 32 skipped, code rules clean (rc 0). The skips come from the environment or are skipped by design: most need scikit-image, which is not installed; some are case-insensitive-file-system tests (this file system is case-sensitive); one is the release-only notebook pin; the rest are permission/root and by-design skips. None of them is in the files this PR touches. The first full run, at0597be5, had 1 failure:test_notebook_cellpose_republished.py::test_a_run_published_while_it_is_opened_is_refusedpatchedRunInputs.open, butopen_runnow goes throughopen_checked. The fix inacfc4d5is v0.9.1: Cellpose cell 4 opens the run once with its wait; the install shows its progress (#574 items 1-2) #575's own change to that test, byte for byte, and the merge with v0.9.1: Cellpose cell 4 opens the run once with its wait; the install shows its progress (#574 items 1-2) #575 is still clean.Owner questions
instances. Choosing "foreground / background only" is refused, with the reason shown. Should a binary declaration of Cellpose masks be possible (recorded asrepresentation = "binary")? That would change the recorded value, so I did not do it.refusal→open_runbefore the widget is displayed. v0.9.1: Cellpose cell 4 opens the run once with its wait; the install shows its progress (#574 items 1-2) #575's "display first, then open" pattern for cell 4 could be applied to cell 5 once v0.9.1: Cellpose cell 4 opens the run once with its wait; the install shows its progress (#574 items 1-2) #575 is merged.Links #574.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WX6rdMV1r5jUPUR94kxV5a